import { useCallback, useState } from "react"
import { createContainer } from '@/utils/unstatedNext'
import { FormInstance } from 'antd/lib'

const useStore = () => {
  const [data, setData] = useState<
    {
      importType: 'file' | 'text'
    }>({
      importType: 'file'
    })
  const [upload, setUpload] = useState(false)

  const onNext = useCallback(async (form: FormInstance) => {
    const value = await form.validateFields().catch(e => e)
    console.log('value', value)
  }, [data])



  return { data, setData, upload, setUpload, onNext }
}


export default createContainer(useStore)